#!/bin/bash

SRC_DIR=../ffmpeg-2.8
INSTALL_DIR=../android/out
COMPILE=arm-linux-androideabi-gcc

cd $SRC_DIR
make clean
rm -rf $INSTALL_DIR

build_one(){  
./configure_android --target-os=linux --prefix=$INSTALL_DIR \
--enable-cross-compile \
--enable-runtime-cpudetect \
--disable-asm \
--arch=arm \
--cc=$COMPILE \
--disable-stripping \
--extra-cflags="-fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a"  \
--enable-gpl --enable-nonfree --enable-version3 --enable-small \
--enable-shared --disable-static \
--disable-doc --disable-programs --disable-debug --disable-ffmpeg --disable-ffprobe --disable-ffplay --disable-ffserver \
--disable-postproc --disable-avdevice  --disable-avfilter  --disable-swresample --disable-swscale \
--disable-everything \
--enable-decoder=h264 --enable-decoder=aac --enable-decoder=mjpeg \
--enable-muxer=mp4 --enable-muxer=flv --enable-muxer=hls --enable-muxer=mov --enable-muxer=mjpeg --enable-muxer=image2 \
--enable-demuxer=mov --enable-demuxer=h264 --enable-demuxer=mpegts --enable-demuxer=flv --enable-demuxer=hls --enable-demuxer=image2 \
--enable-demuxer=image_jpeg_pipe --enable-demuxer=mjpeg --enable-demuxer=rtsp --enable-demuxer=rtp \
--enable-parser=aac --enable-parser=h264 \
--enable-bsf=aac_adtstoasc --enable-bsf=h264_mp4toannexb \
--enable-protocol=file --enable-protocol=hls --enable-protocol=http --enable-protocol=https --enable-protocol=rtp --enable-protocol=tcp --enable-protocol=udp --enable-protocol=rtmp
}  
  
build_one  
  
make  

make install  
  
cd ..
